﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<PagedList<App.Models.vi_ServiceDetail>>" %>
<%@ Import Namespace="Webdiyer.WebControls.Mvc"%>
    <div id="dvList" class="list">
    <table width="100%" cellpadding="0"cellspacing="1" border="0">
        <tr>
            <th>服务号</th>
            <th>逝者编号</th>
            <th>逝者姓名</th>
            <th>服务名称</th>
            <th>计量单位</th>
            <th>价格</th>
            <th>数量</th>
            <th>费用</th>
            <th>申请时间</th>
            <th>是否支付<input type="checkbox" id="chkAll" name="chkAll" /></th>
            <th>支付时间</th>
            <th>收款人</th>   
        </tr>
    <% if (Model != null && Model.Count > 0) foreach (var item in Model){ %>   
        <tr>          
            <td><%: item.ServiceNo %></td>
            <td><%: item.DeadNO %></td>
            <td><%: item.DeadName %></td>
            <td><%: item.ItemName %></td>
            <td><%: item.Unit %></td>
            <td><%: String.Format("{0:F}", item.Price) %></td>
            <td><%: item.ServiceCount %></td>
            <td><%: String.Format("{0:F}", item.ServiceFee) %></td>
            <td><%: String.Format("{0:g}", item.ApplyTime) %></td>
            <td><input type="checkbox" id="PS<%: item.ServiceNo %>" name="chkPayStatus" 
                    subtotals="<%:item.ServiceFee%>" value="<%: item.ServiceNo %>" 
                    <% if(item.PayStatus){ %> checked="checked" disabled="disabled" <%} %>/>                 
            </td>
            <td><%: String.Format("{0:g}", item.PayTime) %></td>
            <td><%: item.Salesman %>
            </td>
        </tr>
    
     <% }
       else { 
    %>
        <tr><td colspan="12"> 没有任何记录！</td></tr>
    <%
       } %>

    </table>
    <%=Html.AjaxPager(Model, new PagerOptions() { 
        CssClass = "page", 
        PageIndexParameterName = "id", 
        ShowMorePagerItems = false, 
        AlwaysShowFirstLastPageNumber = true, 
        ShowNumericPagerItems = true,
        NumericPagerItemCount = App.Models.Utils.PAGE_SIZE,        
        PageIndexOutOfRangeErrorMessage = "索引页超出范围",
        FirstPageText = "<img src='../../images/main_54.gif' />",
        PrevPageText = "<img src='../../images/main_56.gif' />",
        NextPageText = "<img src='../../images/main_58.gif' />",
        LastPageText = "<img src='../../images/main_60.gif' />",        
        GoButtonText = "转",     
        HorizontalAlign = "right",   
        ShowPageIndexBox = true, 
        PageIndexBoxWrapperFormatString = "转到{0}" },
                                new AjaxOptions() { UpdateTargetId = "dvList", HttpMethod = "GET" })%>
    
</div>